package com.hotdog.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.scheduling.annotation.Async;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * 支付订单入库与支付宝回调 支付状态修改
 *
 * @author 郭鲁政
 */
@FeignClient(name = "system", contextId = "payFeignClients")
public interface PayFeignClients {
    /**
     * 调用system服务队定点进行入库操作
     *
     * @param username 用户名
     * @param orderid  订单编号
     */
    @Async
    @GetMapping("/pay/payinfo/{username}/{orderid}")
    void geturl(@PathVariable(name = "username") String username, @PathVariable(name = "orderid") String orderid);

    /**
     * 支付宝回调之后根据订单id与money修改支付状态并添加权限
     *
     * @param money 支付金额
     * @param orderid 订单id
     */
    @Async
    @GetMapping("/pay/returnpayinfo/{money}/{orderid}")
    void returnInfol(@PathVariable(name = "money") String money, @PathVariable(name = "orderid") String orderid);

}
